package cn.diancan.model;

import cn.diancan.util.DateUtil;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Version;

 

/**
 * 进货单货品 
 * @author Sky
 */
@Entity
//@Table(name="PurchaseSaleOrderProduct",uniqueConstraints = {@UniqueConstraint(columnNames={"purchaseOrderId","goodsId","productId"})})
public class PurchaseSaleOrderProduct {
    
    
    private Long id;
    
    private Long purchaseOrderId;
    private Long goodsId;
    private Long productId; //可空

    /*
    private String createTime;
    private String modifyTime;
    */

    //外加
    private String goodsName; //菜品名称
    private String unit;
    
    private Double tagPrice;    //吊牌价  统计
    private Double retailPrice;  //销售价格  
    
    
    private Integer quantity;//总量
    private Double totalPrice;//总价
    
    
    private Float discount; //折扣
    private Double discountPrice; //折扣价
    
    private Double realRetailPrice;//结算价 收款  （显示）
    private Double realTotalPrice; //实际总价 （显示）
    
    private Integer productSaleStatus; //销售类型

    private Long shopClerkId; //无用
    
    private Integer isDelete;
    private Integer version;
    
    @Version
    @Column(name="OPTLOCK",columnDefinition="int(11) DEFAULT 0")
    public Integer getVersion() {
        return version;
    }
    public void setVersion(Integer version) {
        this.version = version;
    }

    @Id
    @GeneratedValue
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPurchaseOrderId() {
        return purchaseOrderId;
    }

    public void setPurchaseOrderId(Long purchaseOrderId) {
        this.purchaseOrderId = purchaseOrderId;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Double getTagPrice() {
        return tagPrice;
    }

    public void setTagPrice(Double tagPrice) {
        this.tagPrice = tagPrice;
    }

    public Double getRetailPrice() {
        return retailPrice;
    }

    public void setRetailPrice(Double retailPrice) {
        this.retailPrice = retailPrice;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
    public Float getDiscount() {
        return discount;
    }
    public void setDiscount(Float discount) {
        this.discount = discount;
    }
    public Double getDiscountPrice() {
        return discountPrice;
    }
    public void setDiscountPrice(Double discountPrice) {
        this.discountPrice = discountPrice;
    }
    public Double getRealRetailPrice() {
        return realRetailPrice;
    }
    public void setRealRetailPrice(Double realRetailPrice) {
        this.realRetailPrice = realRetailPrice;
    }
    public Double getRealTotalPrice() {
        return realTotalPrice;
    }
    public void setRealTotalPrice(Double realTotalPrice) {
        this.realTotalPrice = realTotalPrice;
    }
    public Integer getProductSaleStatus() {
        return productSaleStatus;
    }
    public void setProductSaleStatus(Integer productSaleStatus) {
        this.productSaleStatus = productSaleStatus;
    }
    public Long getShopClerkId() {
        return shopClerkId;
    }
    public void setShopClerkId(Long shopClerkId) {
        this.shopClerkId = shopClerkId;
    }


    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    /*
    @Column(columnDefinition = "DATETIME")
    public String getCreateTime() {
        return DateUtil.getMysqlDateTime(createTime);
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    @Column(columnDefinition = "DATETIME")
    public String getModifyTime() {
        return DateUtil.getMysqlDateTime(modifyTime);
    }
    public void setModifyTime(String modifyTime) {
        this.modifyTime = modifyTime;
    }
    */


}
